﻿package net.wangit.dev.component;

import net.wangit.Unit;
import net.wangit.context.ActionContext;
import net.wangit.dev.ConsoleDomainUtil;
import net.wangit.support.UnitInterceptor;

public class ComponentUI implements UnitInterceptor {

	public ComponentUI() {
	}

	public String intercept(ActionContext ac, Unit unit) throws Exception {
		unit.getElement("domain").setDefaultValue(
				ConsoleDomainUtil.getAndSetDomain());
		unit.getElement("labelrule").setDefaultValue(
				ObjectTreeHelper.getLableRule(ac));
		return unit.write(ac);
	}
}
